﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace collabr8
{
    [Serializable] public class Message
    {
        MessageCode code;
        String header, payload;

        public Message()
        {
            this.code = MessageCode.Chat;
            this.header = "";
            this.payload = ""; 
        }

        public Message(String message)
        {
            this.code = MessageCode.Chat;
            this.header = "";
            this.payload = message;
        }

        public Message(MessageCode code, String message)
        {
            this.code = code;
            this.payload = message;
        }

        public Message(MessageCode code, String header, String message)
        {
            this.code = code;
            this.header = header;
            this.payload = message;
        }

        public MessageCode Code
        {
            get
            {
                return this.code;
            }
            set
            {
                this.code = value;
            }
        }

        public String Header
        {
            get
            {
                return this.header;
            }
            set
            {
                this.header = value;
            }
        }

        public String Text
        {
            get
            {
                return this.payload;
            }
            set
            {
                this.payload = value;
            }
        }

    }

    [Serializable] public enum MessageCode
    { 
        Connect,
        Chat,
        VideoOn,
        VideoOff,
        File,
        FileGet
    }

}
